package org.argus.job.server.system.management.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.argus.common.core.enums.StatusEnum;
import org.argus.job.common.enums.TimeExpressionType;
import org.argus.job.server.system.domain.JobInfoEntity;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
* @author Administrator
* @description 针对表【job_job_info】的数据库操作Mapper
* @createDate 2024-08-07 21:08:08
* @Entity generator.domain.JobInfo
*/
public interface JobInfoMapper extends BaseMapper<JobInfoEntity> {

    List<JobInfoEntity> findToBeScheduledJobs(@Param("appIds")List<Long> appIds,
                                              @Param("timeExpressionTypes") List<TimeExpressionType> timeExpressionTypes,
                                              @Param("timeThreshold") Long timeThreshold);

    long countByAppIdAndStatusInAndIdIn(Long appId, HashSet<StatusEnum> switchableStatuses, Set<Long> allJobIds);
}




